<template>
    <div class="home1111">
        <div class="header">
            <div class="header-left">
                <img src="@/assets/logo.png" alt />
                <span class="name">数据集成融合平台</span>
                <span class="version">6.0.7.6</span>
            </div>
            <div class="header-right">
                <ul class="nav-ul">
                    <router-link
                        class="nav-li"
                        :class="navLiClassName(item.path)"
                        tag="li"
                        v-for="(item, i) in navList"
                        :to="item.path"
                        :key="i"
                    >
                        <span>{{ item.name }}</span>
                    </router-link>
                </ul>
            </div>
        </div>
        <div class="content">
            <div class="main-content">
                <router-view />
            </div>
        </div>
    </div>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import { navList } from "../utils/nav";
@Component({})
export default class Home extends Vue {
    navList: object[] = navList;
    get navLiClassName() {
        return (path: string) => {
            return path === this.$route.path ? "selected-nav-li" : "";
        };
    }
}
</script>

<style lang="scss" scoped>
$header-height: 60px;

.home1111 {
    height: 100%;

    .header {
        height: $header-height;
        border-bottom: 1px solid #dcdee2;
        background: #fff;
        -webkit-box-shadow: 0 0 13px 0 rgba(28, 58, 96, 0.23);
        box-shadow: 0 0 13px 0 rgba(28, 58, 96, 0.23);

        .header-left {
            float: left;
            height: 100%;

            img {
                width: 60px;
                height: 60px;
                padding: 12px;
                background: linear-gradient(90deg, #8148f6, #3b81f7);
            }
            .name {
                font-size: 19px;
                line-height: 60px;
                vertical-align: top;
                margin-left: 10px;
            }
            .version {
                color: #634ff5;
                margin-left: 20px;
                vertical-align: top;
                font-size: 12px;
                line-height: 60px;
            }
        }
        .header-right {
            float: right;
            height: 100%;
            text-align: right;
            .nav-ul {
                font-size: 14px;
                color: #515a6e;
                line-height: 60px;
                height: 100%;

                .nav-li {
                    display: inline-block;
                    box-sizing: border-box;
                    height: inherit;
                    width: 100px;
                    height: 100%;
                    text-align: center;
                    line-height: inherit;
                    cursor: pointer;
                    transition: all 0.2s ease-in-out;
                    font-size: 14px;
                    &:hover {
                        color: #2d8cf0;
                        border-bottom: 2px solid #2d8cf0;
                    }

                    span {
                        display: inline-block;
                        width: 100%;
                        height: 30px;
                        line-height: 30px;
                        vertical-align: middle;
                        border-right: 1px solid rgba(240, 242, 247, 0.8);
                    }
                }

                .selected-nav-li {
                    background: linear-gradient(0deg, #eff1fc, #fff);
                    color: #5b5bf4 !important;
                    border-bottom: 2px solid #5b5bf4;
                }
            }
        }
    }

    .content {
        display: flex;
        width: 100%;
        height: calc(100% - #{$header-height});
        background-color: #fff;
        overflow: auto;

        .main-content {
            width: 100%;
            min-height: 100%;
            height: auto;
            padding: 15px;
            background-color: #fafafa;
        }
    }
}
</style>
